﻿using WorkOne.Domain;
using WorkOne.Domain.Model;
using WorkOne.IRepository;
using WorkOne.IService;

namespace WorkOne.Service
{
    public class GoodsService : IGoodsService
    {
        private readonly GoodsDbContext db;
        private readonly IGoodsRepository regood;

        public GoodsService(GoodsDbContext db, IGoodsRepository regood)
        {
            this.regood = regood;
            this.db = db;
        }

        public bool GoodsAdd(Goods good)
        {
            return regood.Add(good);
        }

        public List<Goods> GetAllGoods()
        {
            return regood.GetAll().ToList();
        }

        public int AddShopCar(Shopcar shopcar)
        {
            return regood.AddShopCar(shopcar);
        }
    }
}